package com.fengwk.cv4j.ind;

import org.junit.Test;
import org.nd4j.linalg.factory.Nd4j;

import com.fengwk.cv4j.factory.ind.INDViewFactory;
import com.fengwk.cv4j.view.View;
import com.fengwk.cv4j.view.ind.INDArrayWrap;

public class Sin {

    @Test
    public void test() {
        INDViewFactory f = new INDViewFactory();
        View<INDArrayWrap> X = f.of(Nd4j.create(new float[][] {
                {7, 0, -9},
                {0.55f, -113, 12}
        }));
        
        View<INDArrayWrap> sin = f.sin(X);
        View<INDArrayWrap> d_sin = sin.gradient(X);
        
        System.out.println("------sin------");
        System.out.println(sin.compute());
        System.out.println("------d_sin------");
        System.out.println(d_sin.compute());
    }
    
}
